#define __FORCE_TRACE__
//#define __FORCE_DEBUG__
//#define __FORCE_INFO__
#define THIS_FILE "tyr_menu\fn_removeItem.sqf"
#include <core_macros.h>

TRACE_1("Start",_this);
TMFPROFILERSTART;

private ["_id","_result","_params"];
DEFAULT_PARAM(_id,0,-1);
if (isNil QGVAR(added_items)) then { GVAR(added_items) = []; };
_result = false;
if (typename _id == typename 0) then {
	if (_id > 0 && (round(_id) == _id)) then {
		if (_id < (count GVAR(added_items))) then {
			GVAR(added_items) set [_id, nil];
		} else {
			ERROR_1("ID Out of bounds",_id);
		};
	} else {
		DEBUG_1("Not a valid ID",_id);
		_result = true;
	};
} else {
	DEBUG_1("Not a number",_id);
	_result = true;
};

TRACE_1("End",_result);
TMFPROFILERSTOP;
_result